import App from './App'
import store from './store'
//import './Utils/Interceptor';//引入拦截
//import DES3 from './Utils/DES3';
//import http from './Utils/http.js';
// #ifndef VUE3
import Vue from 'vue'
import Json from './json' //测试用数据
import http  from  './http' 
import DES  from  'Utils/DES3.js' 
import request from "Utils/request.js";
import utils from "Utils/utils.js";
Vue.prototype.http = http;
Vue.prototype.DES = DES;
Vue.prototype.request = request;
Vue.prototype.utils = utils;
const json = type=>{
	//模拟异步请求数据
	return new Promise(resolve=>{
		setTimeout(()=>{
			resolve(Json[type]);
		}, 10)
	})
}

const prePage = ()=>{
	let pages = getCurrentPages();
	let prePage = pages[pages.length - 2];
	// #ifdef H5
	return prePage;
	// #endif
	return prePage.$vm;
}
const msg = (title, duration=1500, mask=false, icon='none')=>{
	//统一提示方便全局修改
	if(Boolean(title) === false){
		return;
	}
	uni.showToast({
		title,
		duration,
		mask,
		icon
	});
}


Vue.config.productionTip = false
Vue.prototype.$store = store;
Vue.prototype.$api = {msg, json, prePage};
App.mpType = 'app'
const app = new Vue({
    ...App
})
//Vue.prototype.$http = http//赋值到vue里面
//Vue.prototype.$DES3 = DES3//赋值到vue里面
app.$mount()
/* import uView from './uni_modules/uview-ui'
 Vue.use(uView) */
// main.js
import uView from "@/pagesB/uview-ui";
Vue.use(uView);
/* 颜色变量 */

// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif